import { Component, OnInit, Input } from '@angular/core';
import {Hero} from '../hero'

@Component({
  selector: 'heroes-detail',
  // templateUrl: './hero-detail.component.html',
  template: `
<div *ngIf="hero">
<h2>{{hero.name}} details!</h2>
<div><label>id: </label>{{hero.id}}</div>
<div>
    <label>name: </label>
    <input [(ngModel)]="hero.name" placeholder="name"/>
</div>
</div>
  `,
  styleUrls: ['./hero-detail.component.css']
})
export class HeroDetailComponent implements OnInit {

  constructor() { }

  ngOnInit() {
  }
  @Input() hero: Hero;
}
